package com.sunxu.exercise6;

/**
 * ${DESCRIPTION}
 *
 * @author Sun
 * @create 2017-08-02-13:23
 */
public class MyThread6 extends Thread {

    @Override
    public void run() {
        long beginTime = System.currentTimeMillis();
        int count = 0;

        for (int i = 0; i < 50000000; i++) {
//            Thread.yield();
            count = count + (i + 1);
        }

        long endTime = System.currentTimeMillis();
        System.out.println("用时:" + (endTime - beginTime) + "毫秒!");
    }
}
